package gr.handmademarket.ui;

import gr.handmademarket.ui.pages.CategoryPage;
import gr.handmademarket.ui.pages.CheckoutPage;
import gr.handmademarket.ui.pages.HomePage;
import gr.handmademarket.ui.pages.LoginPage;
import gr.handmademarket.ui.pages.MyBasketPage;
import gr.handmademarket.ui.pages.NewsLetterPage;
import gr.handmademarket.ui.pages.ProductDetailsPage;
import gr.handmademarket.ui.pages.SellerAdminPage;
import gr.handmademarket.ui.pages.UploadProductPage;

import org.apache.wicket.Page;
import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.settings.IRequestCycleSettings;

/**
 * hand made market web application class.
 */
public class WebHandMadeMarketApplication 
extends AuthenticatedWebApplication{
	
	
	@Override
	public Class<? extends Page> getHomePage() {
		//return HomePage.class;
		return NewsLetterPage.class;
	}
	
	@Override
	protected Class<? extends WebPage> getSignInPageClass() {
		return LoginPage.class;
	}
	
	@Override
	protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass() {
		return WebHandMadeSession.class;
	}	
	
	@SuppressWarnings("nls")
	@Override
	protected void init() {
		super.init();
		getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.RenderStrategy.ONE_PASS_RENDER);
		mountPage("index", NewsLetterPage.class);
		mountPage("upload", UploadProductPage.class);
		mountPage("myBasket", MyBasketPage.class);
		mountPage("checkout", CheckoutPage.class);
		mountPage("product", ProductDetailsPage.class);
		mountPage("home", HomePage.class);
		mountPage("category", CategoryPage.class);
		mountPage("sellerProfile", SellerAdminPage.class);
	}

}
